<template>
    <div class="right-view">
        <div class="header">
            <div class="navigation">
                <div class="time">{{ fromData.navigationTime }}</div>
                <div class="right-div">
                    <!-- <div class="wf-div">
                        wfUrl
                    </div> -->
                    <img class="wf-div" :src="wfUrl" />
                    <div class="dl-div">
                        <!-- <div class="dl-bg"></div> -->
                        <img class="dl-bg" :src="dianlaingUrl" />

                        <div class="dl" :style="'width: ' + (fromData.quantityOfElectricity / 2) * 1.3 + '%;'">
                            <!-- {{ fromData.quantityOfElectricity }} -->
                        </div>
                    </div>
                </div>
            </div>
            <div class="titleBar">
                <div class="left-view">
                    <!-- <div class="left-icon"></div> -->
                    <img class="left-icon" :src="rightUrl" />
                    <div class="user-info">
                        <div class="touxiang">
                            <el-avatar :size="100" :src="fromData.avatarUrl2 ? fromData.avatarUrl2 : fromData.avatarUrl" />
                            <div v-if="fromData.isShowDian == 1" class="lvdian"></div>
                        </div>
                        <div class="user">
                            <div class="title">{{ fromData.userName }}</div>
                            <div class="info">{{ fromData.onTextEditText }}</div>
                        </div>
                    </div>
                </div>
                <img class="right-view" :src="moreUrl" />
                <!-- <div class="right-view">
                    <div class="right-more"></div>
                </div> -->
            </div>
            <div class="line-view"></div>
        </div>
        <div class="list-view">
            <div v-for="item in fromData.listData" :key="item">
                <!-- 剧中时间 -->
                <div class="timeText" v-if="item.msgType == 'timeText'" :style="'font-family:' + fromData.dateFont + ''">
                    {{ item.centerTime }}
                </div>
                <!-- 提示文本 -->
                <div class="rightTips" v-if="item.msgType == 'rightTips'" :style="item.rightTextColor == 'hongse' ? 'color:#FF4B3A' : ''">
                    {{ item.rightText }}
                </div>
                <!-- 用户信息 -->
                <div class="adminInfo" v-if="item.msgType == 'adminInfo'">
                    <!-- <img :size="100" style="width: 100px; height: 100px;"  :src="item.avatarUrl" /> -->
                    <!-- <img id="myImage" src="https://picsum.photos/400/600" alt="示例图片" /> -->
                    <!-- <div id="container">
                        <img id="myImage" :src="item.avatarUrl" />
                    </div> -->
                    <el-avatar :size="100" :src="item.avatarUrl2 ? item.avatarUrl2 : item.avatarUrl" />

                    <div class="userName" :style="'font-family:' + fromData.adminNameFont + ''">{{ item.userName }}</div>
                    <div class="idStr" :style="'font-family:' + fromData.adminIdFont + ''">{{ item.idStr }}</div>
                    <div class="admin" :style="'font-family:' + fromData.adminFsFont + ''">{{ item.admin }}个关注账号 · {{ item.fsNumber }}个粉丝</div>
                    <!-- <div class="fsNumber"></div> -->
                </div>

                <!-- 发送消息内容 -->
                <div class="sendText" v-if="item.msgType == 'sendText'" :style="item.leftAndRight == 'right' ? 'justify-content: flex-end' : ''">
                    <!-- {{ item.leftAndRight }} -->
                    <div class="left" v-if="item.leftAndRight == 'left'">
                        <el-avatar :size="100" :src="fromData.avatarUrl" />
                        <div class="text" :style="'font-family:' + fromData.qipaoFont + ''">
                            {{ item.textValue }}
                        </div>
                    </div>
                    <div class="right" v-if="item.leftAndRight == 'right'" :style="'font-family:' + fromData.qipaoFont + ''">
                        {{ item.textValue }}
                    </div>
                </div>

                <!-- 发送图片 -->
                <div class="imageType" v-if="item.msgType == 'imageType'">
                    <div class="left" v-if="item.leftAndRight == 'left'">
                        <div class="left-biaoqing">
                            <el-avatar :size="100" :src="fromData.avatarUrl" />
                            <img v-if="item.image == 'image1'" class="biaoqiang" :src="bqUrl" />
                            <img v-if="item.image == 'image2'" class="biaoqiang" :src="bqxiaolianUrl" />
                            <img v-if="item.image == 'image3'" class="biaoqiang" :src="bqdianzanUrl" />
                            <img v-if="item.image == 'image4'" class="biaoqiang" :src="bqchuoyichuoUrl" />
                        </div>
                        <div class="huifu">
                            <img :src="xiaolianUrl" />
                            <div>回复</div>
                        </div>
                        <!-- <img class="huifu" :src="huifuUrl" /> -->
                    </div>
                    <div class="right" v-if="item.leftAndRight == 'right'">
                        <!-- {{ item.image }} -->
                        <img v-if="item.image == 'image1'" class="biaoqiang" :src="bqUrl" />
                        <img v-if="item.image == 'image2'" class="biaoqiang" :src="bqxiaolianUrl" />
                        <img v-if="item.image == 'image3'" class="biaoqiang" :src="bqdianzanUrl" />
                        <img v-if="item.image == 'image4'" class="biaoqiang" :src="bqchuoyichuoUrl" />
                    </div>
                </div>
            </div>
        </div>

        <div class="bottom-view">
            <img crossorigin="anonymous" :src="bottomViewUrl" />
        </div>
    </div>
</template>

<script setup>
import image from "@/assets/images/logonew.png";
import xiaolian from "@/assets/images/xiaolianhui2.jpg";
import bq from "@/assets/images/bq.jpg";
import bq2 from "@/assets/images/bq2.jpg";
import bq3 from "@/assets/images/bq3.jpg";
import bq4 from "@/assets/images/bq4.jpg";

import bottomView from "@/assets/images/bottom-view.jpg";
import wf from "@/assets/images/wf.jpg";
import dianlaing from "@/assets/images/dianlaing1.jpg";
import right from "@/assets/images/right.png";
import more from "@/assets/images/more.jpg";
import logo from "@/assets/logo.png";
import imageView from "./image-view.vue";
const bqUrl = bq;
const bqxiaolianUrl = bq2;
const bqdianzanUrl = bq3;
const bqchuoyichuoUrl = bq4;

const bottomViewUrl = bottomView;
const wfUrl = wf;
const dianlaingUrl = dianlaing;
const rightUrl = right;
const moreUrl = more;
const logoUrl = logo;

const imageUrl = image;
const xiaolianUrl = xiaolian;

const props = defineProps({
    fromData: {
        type: Object,
        default: {},
    },
});
</script>

<style lang="scss" scoped>
::-webkit-scrollbar {
    width: 0;
    height: 0;
}
.right-view {
    // background-color: #f8f9f7;
    position: relative;
    .header {
        background-color: #f4f4f4;
        .navigation {
            display: flex;
            justify-content: space-between;
            height: 34px;
            align-items: center;
            .time {
                margin-left: 30px;
                font-weight: 700;
                color: #000;
                font-size: 12px;
            }
            .right-div {
                display: flex;
                align-items: center;
                margin-right: 0px;
                height: 100%;
                .wf-div {
                    height: 12px;
                    width: 35px;
                    // background: url(../../../assets/images/wf.jpg) no-repeat center/cover;
                }
                .dl-div {
                    position: relative;
                    width: 24.8px;
                    height: 18.8px;
                    display: flex;
                    margin-left: 5px;
                    margin-bottom: 5px;
                    margin-right: 8px;
                    .dl-bg {
                        position: absolute;
                        top: 7px;
                        height: 10px;
                        width: 21.71px;
                        // background: url(../../../assets/images/dianlaing1.jpg) no-repeat center/cover;
                    }
                    .dl {
                        position: absolute;
                        height: 6.4px;
                        // top: 8.8px;
                        top: 8.9px;
                        left: 1.8px;
                        border-radius: 2px;
                        background-color: #020202;
                    }
                }
            }
        }
        .titleBar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            height: 34px;
            .left-view {
                display: flex;
                align-items: center;
                margin-left: 15px;
                .left-icon {
                    height: 17px;
                    width: 18px;
                    // background: url(../../../assets/images/right.jpg) no-repeat center/cover;
                }
                .user-info {
                    display: flex;
                    margin-left: 10px;

                    .touxiang {
                        display: block;
                        width: 30px;
                        height: 30px;
                        position: relative;
                        .el-avatar {
                            position: absolute;
                            width: 30px;
                            height: 30px;
                        }
                        .lvdian {
                            width: 12px;
                            position: absolute;
                            height: 12px;
                            right: 0;
                            bottom: 0;
                            background-color: #5dd271;
                            border-radius: 6px;
                            border: 2px solid #f6f2e1;
                        }
                    }
                    .user {
                        display: flex;
                        flex-direction: column;
                        margin-left: 8px;
                        .title {
                            font-size: 12px;
                            font-weight: 800;
                            color: #060606;
                        }
                        .info {
                            font-size: 9px;
                            color: #989898;
                            font-weight: 500;
                        }
                    }
                }
            }
            .right-view {
                height: 20px;
                margin-right: 10px;
                width: 50px;
                // background: url(../../../assets/images/more.jpg) no-repeat center/cover;
            }
        }
        .line-view {
            // background-color: #f5f5f5;
            background-color: #ebebeb;
            height: 1px;
            margin-top: 3px;
            width: 100%;
        }
    }

    .list-view {
        height: 425px;
        overflow-y: auto;
        padding-bottom: 10px;
        // background-color: #f8f9f7;

        .timeText {
            color: #858585;
            font-size: 9px;
            font-weight: 600;
            margin: 20px 0;
            text-align: center;
        }
        .rightTips {
            color: #858585;
            font-size: 10px;
            font-weight: 600;
            // margin: 20px 0;
            text-align: right;
            padding-right: 10px;
        }
        .adminInfo {
            display: flex;
            flex-direction: column;
            align-items: center;
            .el-avatar {
                display: block;
                width: 70px;
                height: 70px;
                margin: 10px;
            }
            .image-view {
                display: block;
                width: 70px;
                height: 70px;
                margin: 10px;
            }
            #container {
                width: 100px;
                height: 100px;
                overflow: hidden;
                position: relative;
                #myImage {
                    position: absolute;
                    min-width: 100%;
                    min-height: 100%;
                    top: 50%;
                    left: 50%;
                    transform: translate(-50%, -50%);
                }
            }

            .userName {
                font-size: 16px;
                font-weight: 800;
                margin-top: 5px;
                color: #060606;
            }
            .idStr {
                color: #858585;
                font-size: 10px;
                margin-top: 5px;
                font-weight: 600;
            }
            .admin {
                color: #858585;
                font-size: 10px;
                margin-top: 5px;
                font-weight: 600;
            }
        }
        .sendText {
            font-size: 12px;
            display: flex;
            .left {
                display: flex;
                margin-left: 4px;
                align-items: flex-end;
                .el-avatar {
                    width: 25px;
                    display: block;
                    height: 25px;
                }
                .text {
                    word-break: break-all;
                    margin-left: 10px;
                    max-width: 180px;
                    color: #0d0d0d;
                    background-color: white;
                    border-radius: 14px;
                    margin-bottom: 5px;
                    padding: 8px;
                    margin-right: 10px;
                    font-weight: 500;
                    display: flex;
                }
                margin: 10px;
            }
            .right {
                max-width: 200px;
                color: #bcedf5;
                background-color: #4fb5d5;
                border-radius: 10px;
                padding: 8px;
                word-break: break-all;
                margin: 3px;
                margin-right: 10px;
            }
        }
        .imageType {
            font-size: 13px;
            display: flex;

            .left {
                display: flex;
                align-items: center;
                // margin: 4px;
                margin-top: 6px;
                margin-bottom: 6px;
                .left-biaoqing {
                    display: flex;
                    margin-left: 10px;
                    align-items: flex-end;
                    .el-avatar {
                        width: 25px;
                        display: block;
                        height: 25px;
                    }
                    .biaoqiang {
                        width: 70px;
                        // height: 80px;
                        margin-left: 10px;
                    }
                }

                .huifu {
                    margin-left: 10px;
                    display: flex;
                    background-color: #ebebeb;
                    width: 50px;
                    justify-content: center;
                    align-items: center;
                    padding: 3px;
                    border-radius: 10px;
                    height: 25px;
                    img {
                        width: 15px;
                    }
                    div {
                        color: #000;
                        font-size: 10px;
                        margin-left: 3px;
                        font-weight: 800;
                    }
                }
            }
            .right {
                display: flex;
                width: 100%;
                justify-content: flex-end;
                margin-right: 15px;
                margin-bottom: 10px;
                .biaoqiang {
                    width: 70px;
                    // height: 100px;
                }
                // max-width: 200px;
                // color: #bcedf5;
                // background-color: #4fb5d5;
                // border-radius: 10px;
                // padding: 8px;
                // margin: 10px;
                // margin-right: 13px;
            }
        }
    }

    .bottom-view {
        position: absolute;
        bottom: 0;
        width: 100%;
        img {
            // height: 104px;
            height: 111px;
            display: flex;
        }
        // background: url(../../../assets/images/bottom-view.jpg) no-repeat center/cover;
    }
}
</style>
